\hypertarget{group__init}{\subsection{Library initialisation and management}
\label{group__init}\index{Library initialisation and management@{Library initialisation and management}}
}
\subsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{group__init_ga9351fa3ec8eeff4e9d998d3d5d912a4f}{bcm2835\-\_\-init} (void)
\item 
int \hyperlink{group__init_ga3a42892f61764132d106a4ae32271002}{bcm2835\-\_\-close} (void)
\item 
void \hyperlink{group__init_gaf1a6cc6b217b8ff0270ef99300c29e3c}{bcm2835\-\_\-set\-\_\-debug} (uint8\-\_\-t debug)
\end{DoxyCompactItemize}


\subsubsection{Detailed Description}
These functions allow you to intialise and control the bcm2835 library 

\subsubsection{Function Documentation}
\hypertarget{group__init_ga3a42892f61764132d106a4ae32271002}{\index{Library initialisation and management@{Library initialisation and management}!bcm2835\-\_\-close@{bcm2835\-\_\-close}}
\index{bcm2835\-\_\-close@{bcm2835\-\_\-close}!Library initialisation and management@{Library initialisation and management}}
\paragraph[{bcm2835\-\_\-close}]{\setlength{\rightskip}{0pt plus 5cm}int bcm2835\-\_\-close (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__init_ga3a42892f61764132d106a4ae32271002}
Close the library, deallocating any allocated memory and closing /dev/mem \begin{DoxyReturn}{Returns}
1 if successful else 0 
\end{DoxyReturn}
\hypertarget{group__init_ga9351fa3ec8eeff4e9d998d3d5d912a4f}{\index{Library initialisation and management@{Library initialisation and management}!bcm2835\-\_\-init@{bcm2835\-\_\-init}}
\index{bcm2835\-\_\-init@{bcm2835\-\_\-init}!Library initialisation and management@{Library initialisation and management}}
\paragraph[{bcm2835\-\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}int bcm2835\-\_\-init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{group__init_ga9351fa3ec8eeff4e9d998d3d5d912a4f}
Initialise the library by opening /dev/mem and getting pointers to the internal memory for B\-C\-M 2835 device registers. You must call this (successfully) before calling any other functions in this library (except bcm2835\-\_\-set\-\_\-debug). If \hyperlink{group__init_ga9351fa3ec8eeff4e9d998d3d5d912a4f}{bcm2835\-\_\-init()} fails by returning 0, calling any other function may result in crashes or other failures. Prints messages to stderr in case of errors. \begin{DoxyReturn}{Returns}
1 if successful else 0 
\end{DoxyReturn}


Here is the call graph for this function\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=290pt]{group__init_ga9351fa3ec8eeff4e9d998d3d5d912a4f_cgraph}
\end{center}
\end{figure}


\hypertarget{group__init_gaf1a6cc6b217b8ff0270ef99300c29e3c}{\index{Library initialisation and management@{Library initialisation and management}!bcm2835\-\_\-set\-\_\-debug@{bcm2835\-\_\-set\-\_\-debug}}
\index{bcm2835\-\_\-set\-\_\-debug@{bcm2835\-\_\-set\-\_\-debug}!Library initialisation and management@{Library initialisation and management}}
\paragraph[{bcm2835\-\_\-set\-\_\-debug}]{\setlength{\rightskip}{0pt plus 5cm}void bcm2835\-\_\-set\-\_\-debug (
\begin{DoxyParamCaption}
\item[{uint8\-\_\-t}]{debug}
\end{DoxyParamCaption}
)}}\label{group__init_gaf1a6cc6b217b8ff0270ef99300c29e3c}
Sets the debug level of the library. A value of 1 prevents mapping to /dev/mem, and makes the library print out what it would do, rather than accessing the G\-P\-I\-O registers. A value of 0, the default, causes normal operation. Call this before calling \hyperlink{group__init_ga9351fa3ec8eeff4e9d998d3d5d912a4f}{bcm2835\-\_\-init()}; 
\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em debug} & The new debug level. 1 means debug \\
\hline
\end{DoxyParams}
